package pl.edu.agh.pros.connector;

import pl.edu.agh.pros.conf.XMPPConfiguration;

public interface IServerConnector {

	/**
	 * 
	 * @param appKey
	 * @param devId
	 * @return XMPP server configuration
	 */
	public XMPPConfiguration getXMPPConfiguration(String appKey, String devId);

	/**
	 * 
	 * @param appKey
	 * @param devId
	 * @param xmppAddress
	 * @return registration time
	 * @throws InterruptedException
	 */
	public Long register(String appKey, String devId, String xmppAddress);

	/**
	 * 
	 * @param appKey
	 * @param devId
	 * @return XMPP address associated with devId or provider XMPP address if
	 *         devId is null
	 */
	public String getXmppAddress(String appKey, String devId);

	/**
	 * provider only
	 * 
	 * @param appKey
	 * @param topicName
	 * @param roomName
	 * @return registration time
	 */
	public Long registerTopic(String appKey, String topicName, String roomName);

	/**
	 * provider only
	 * 
	 * @param appKey
	 * @param topicName
	 */
	public void unregisterTopic(String appKey, String topicName);

	public String getRoomName(String appKey, String topicName);

}
